/ Assembly List / LJCNetCommon / CodeTokenizer / ClearRemainingTokens

Namespace - LJCNetCommon


Parameters
tokenIndex - The token index.

Syntax

C#
public Void ClearRemainingTokens(Int32 tokenIndex)

Clears all the remaining tokens; starting with the specified token index. (E)

Example

C#
using LJCNetCommon;
        
var tokenizer = new CodeTokenizer();
string text = " string text = " // This is a comment.";
tokenizer.SetTokens(text);
short tokenIndex = 0;
string token = tokenizer.GetToken(tokenIndex);
if (tokenizer.IsComment(token))
{
  // Remaining tokens are not processed.
  tokenizer.ClearRemainingTokens(tokenIndex + 1);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.